(SST) ShlWAPI.pas Version 1.08

Developer Reference
(SST)ShlWAPI MLFreeLibrary Function
Unloads a Multilingual User Interface (MUI) resource dll previously loaded with MLLoadLibrary.
Scope
Global (i.e. this function can be called/accessed from code in any unit that includes/uses (SST)ShlWAPI.pas).
Syntax
function MLFreeLibrary(moduleh : HMODULE) : BOOL;
Parameters
moduleh [in] The handle to the MUI resource dll to unload. This should be a handle preivously acquired by means of MLLoadLibrary.
Return Values
Returns TRUE on success, FALSE on failure.
Remarks
Modules loaded with MLLoadLibrary should always be freed using this function (MLFreeLibrary), and not FreeLibrary.
If the function fails, call the Windows API function GetLastError to obtain additional information on the cause for the error.
This function is exported by name as of ShlWAPI.dll version 6.0 under Windows Vista, but according to the documentation it is supported as of ShlWAPI.dll 5.0 under all Windows operating systems (including the 9x series) with IE 5.0 and later. However, this is incompatible with the declaration of the function prototype in ShlWAPI.h, which requires at least Windows 2000, and the fact that an ordinal by which the function can be accessed under pre-Vista systems was not documented.
We were able to ascertain that MLFreeLibrary can be imported by ordinal 418, as early as of Windows NT 4.0 with IE 5.0 and Windows 98 SE. However, the function is possibly no longer supported under Windows 10, as it is neither exported by ordinal 418, nor by name in that ShlWAPI.dll version. Should this actually be the case, it would be somewhar inconsequent, as the counterparts to MLFreeLibrary, MLLoadLibraryA and MLLoadLibraryW (which see) are still exported by the same ordinals (377 and 378, respectively) as under previous ShlWAPI.dll versions.
Example
PROCEDURE TForm4.TestShlWAPIMLFreeLibrary(Sender : TObject); VAR apiretval : BOOL; VAR newinfoline : STRING; BEGIN apiretval := FALSE; newinfoline := ''; //ShowMessage('MLFreeLibrary'); newinfoline := 'MLFreeLibrary called with fmlresmoduleh = 0x' + IntToHex(fmlresmoduleh, 8) + ' (' + IntToStr(fmlresmoduleh) + ') returned'; Memo1.Lines.Add(newinfoline); apiretval := MLFreeLibrary(fmlresmoduleh); IF apiretval = TRUE THEN newinfoline := 'TRUE' ELSE newinfoline := 'FALSE'; Memo1.Lines.Add(newinfoline); Memo1.Lines.Add(''); END;
For an example of the output produced by the above example please refer to the SST description of the MLLoadLibrary function.
Requirements
Unit: Declared and imported in (SST)ShlWAPI.pas
Library: (SST)ShlWAPI.dcu/(SST)ShlWAPI.obj
Unicode: Not applicable.
Min. ShlWAPI.dll version according to MS SDK doc.: 5.0
Min. ShlWAPI.dll version based on SST research: 5.0
Min. OS version(s) according to Microsoft SDK doc.: Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5
Min. OS version(s) according to SST research.: Windows NT 4.0 with IE 5.0, Windows 98 SE, Windows 2000
See Also
MLLoadLibrary.
 
Windows APIs: MLFreeLibrary, MLLoadLibrary, GetLastError.


Document/Contents version 1.00
Page/URI last updated on 07.12.2023
 
Copyright © Stoelzel Software Technologie (SST) 2010 - 2017
Suggestions and comments mail to:
webmaster@stoelzelsoftwaretech.com